var hotkeys = [];

var init = function() {
  hotkeys = window.arguments[0];
  //dump("init setting " + hotkeys.length);
  for (var i = 0; i < hotkeys.length; i++){
    if(hotkeys[i].value != undefined) {
      document.getElementById("F" + (i + 1)).value = hotkeys[i].value;
    }
  }
}

var save_setting = function() {
  for (var i = 0; i < hotkeys.length; i++){
    var seturl = document.getElementById("F" + (i + 1)).value;
    hotkeys[i].value = seturl;
  }
  var prefSvc = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService);
  var prefBranch = prefSvc.getBranch('fkeyshortcut.');
  prefBranch.setCharPref('hotkey', hotkeys.toSource());
}
